package com.test.designPattern.ch2;

import com.test.designPattern.ch2.color.Blue;
import com.test.designPattern.ch2.color.Color;
import com.test.designPattern.ch2.color.Green;
import com.test.designPattern.ch2.color.Red;
import com.test.designPattern.ch2.shape.Shape;

public class ColorFactory extends AbstractFactory {
    @Override
    Shape getShape(String shape) {
        return null;
    }

    @Override
    Color getColor(String color) {
        if("red".equalsIgnoreCase(color)){
            return new Red();
        } else if("green".equalsIgnoreCase(color)){
            return new Green();
        } else if("blue".equalsIgnoreCase(color)){
            return new Blue();
        }
        return null;
    }
}
